package com.heima.mongo.pojos;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 人类的实体
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document("person")//表示当前实体类与mongo的集合相映射的关系，类似于实体类与mysql表的映射关系
public class Person {
    //id
    @Id //表示主键
    private Long id;
    //姓名
    private String name;
    //年龄
    private int age;
    //地址
    private Address address;
}